package com.es.hr.visitorscore;

import javax.servlet.http.HttpServletRequest;

import com.es.business.area.AreaBiz;
import com.es.util.page.PageBean;
import com.opensymphony.webwork.interceptor.ServletRequestAware;
import com.opensymphony.xwork.ActionSupport;

public class AreaListPopAction extends ActionSupport implements ServletRequestAware {

	private static final long serialVersionUID = 1L;
	HttpServletRequest request;
	
	@Override
	public String execute() throws Exception {
		String result = "";
		AreaBiz areaBiz = new AreaBiz();
		String code = this.request.getParameter("area_code");
		if(code == null) code = "";
		String value = this.request.getParameter("area_value");
		if(value == null) value = "";

		String cp = this.request.getParameter("curpage");
		if(cp == null) cp = "1";
		int curpage = Integer.parseInt(cp);
		PageBean pb = areaBiz.searchArea(code, value, curpage);
		this.request.setAttribute("pageBean", pb);
		this.request.setAttribute("area_code", code);
		this.request.setAttribute("area_value", value);
		result = "success";
		return result;
		
	}



	public void setServletRequest(HttpServletRequest request) {
		this.request = request;
	}
	
	
}
